package com.woniuxy.amusementparkos.interceptor.xxy;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;
@Component
public class StoreLoginInterceptor implements HandlerInterceptor {
	
	@Override
	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
			throws Exception {
		Object store_id = request.getSession().getAttribute("store_id");
		if(null==store_id) {
			response.sendRedirect("/store/user/storeLogin");
			return false;
		}else {
			return true;
		}
	}
}
